package com.jp.knowledge.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.jp.knowledge.R;

import org.xutils.common.util.DensityUtil;

/**
 * Created by 528787067@qq.com on 2017/4/19.
 */

public class ReviewDetailDialog extends Dialog {

    private View contentView;
    private TextView reviewDetailView;

    public ReviewDetailDialog(Context context) {
        super(context, R.style.custom_idalgo);
        contentView = View.inflate(context, R.layout.dialog_review_detail, null);
        reviewDetailView = (TextView) contentView.findViewById(R.id.review_detail_view);
        setContentView(contentView);
        getWindow().getAttributes().width = (int)(DensityUtil.getScreenWidth() * 0.9);
        getWindow().getAttributes().height = (int)(DensityUtil.getScreenHeight() * 0.7);
    }

    @Override
    public void show() {
        show(null);
    }

    public void show(String detail){
        if(detail == null)
            detail = "";
        reviewDetailView.setText(detail);
        super.show();
    }
}
